<!DOCTYPE html>
<html lang="en">
<head>
     <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
     </script>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form  class="haha"     action="http://43.140.252.84:8888" method="post">
        id     <input  id="username" type="text" name="username"><br>
        passwd <input  id="passwd" type="password" name="password"><br>
        <input type="submit" value="提交" name="submit ">


    </form>
    <button onclick="test()">简单的按钮</button>
</body>
<script>
        function test()
        {
            var login_info={
                username:document.getElementById("username").value,
                passwd:document.getElementById("passwd").value
            }
            $.ajax({
                type:"post",
                url:"http://43.140.252.84:8888",
                data:JSON.stringify(login_info),
                success:function(res,statu,xhr)
                {
                    alert(res);
                },
                error:function(xhr)
                {
                    alert(JSON.stringify(xhr))
                }
            })
        }

</script>
</html>